package com.fudan.sms.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Author Xie YangZe(谢杨泽)
 * @Date 2020/6/7
 * @Time 18:28
 */
@AllArgsConstructor
@Getter
public enum ShopOperateEnum {
    PRINT("1", "输出所有商品"),
    ADD("2", "增加一种商品"),
    DELETE("3", "删除一种商品"),
    SELECT("4", "查询一种商品"),
    QUIT("5", "退出系统");

    private String operate;
    private String description;


    public static ShopOperateEnum getEnum(String operate) {
        ShopOperateEnum[] values = ShopOperateEnum.values();
        for (ShopOperateEnum enumObject : values) {
            if (enumObject.getOperate().equals(operate)) {
                return enumObject;
            }
        }
        return null;
    }
}
